import request from '/@/utils/request';
export function dispatchApi() {
	return {
		create: (data: object) => {
			return request({
				url: 'management/dispatch/create',
				method: 'post',
				data,
			});
		},

		update: (data: object) => {
			return request({
				url: 'management/dispatch/update',
				method: 'put',
				data,
			});
		},

		delete: (id: string) => {
			return request({
				url: `management/dispatch/delete/${id}`,
				method: 'delete',
			});
		},

		view: (id: string) => {
			return request({
				url: `management/dispatch/view/${id}`,
			});
		},

		search: (data: object) => {
			return request({
				url: 'management/dispatch/search',
				method: 'post',
				data,
			});
		},

		rateAares: (id: string) => {
			return request({
				url: `management/dispatch/query/rateareas/${id}`,
				method: 'GET',
			});
		},

		searchList: (data: object) => {
			return request({
				url: 'management/dispatch/searchlist',
				method: 'post',
				data,
			});
		},
	};
}
